<template>
    <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' style="height:25px;">
        <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
        <input class="mui-numbox-input" type="number" ref="numbox" :value="initcount" @change="changeCount"/>
        <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
    </div>
</template>

<script>
import mui from '@/lib/mui/js/mui.min.js'
export default {
    props:["initcount","id"],
    mounted(){
        mui(".mui-numbox").numbox()
    },
    methods:{
        changeCount(){
            this.$store.commit('updateCar',{id:this.id,count:Number(this.$refs.numbox.value)})
        }
    }
}
</script>

<style lang="scss" scoped>

</style>
